package com.ebring.shareEducation.controller;

import com.ebring.shareEducation.bean.User;
import com.ebring.shareEducation.bean.UserVIP;
import com.ebring.shareEducation.service.UserVIPService;
import com.ebring.shareEducation.utils.RspMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserVIPController {
    @Autowired
    private UserVIPService userVIPService;

    /**
     * 查询当前用户会员状态
     * @param userId
     * @return
     */
    @PostMapping("/user/selectUserVipStatus")
    public RspMsg<UserVIP> selectUserVipStatus(String userId) {
        return userVIPService.selectUserVipStatus(userId);
    }

    /**
     * 找老师（找人才）
     *
     * @param skillsName 技能名称
     * @return
     */
    @GetMapping("/user/selectTeacher")
    public RspMsg<User> selectTeacher(String skillsName) {
        return userVIPService.selectTeacher(skillsName);
    }


    /**
     * 积分换取会员
     * @param userId
     * @param money
     * @param vipLevel
     * @return
     */
    @PostMapping("/user/ScorechargeVIP")
    public RspMsg<User> ScorechargeVIP(String userId ,String money, String vipLevel) {
        return userVIPService.ScorechargeVIP(userId,money,vipLevel);
    }
}
